<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>实现图片的毛玻璃效果</title>
    <style>
        .background {
            width: 260px;
            height: 200px;
            overflow: hidden;
        }

        .background-content {
            width: 260px;
            height: 100%;
            position: relative;
            /* 让图片居中显示 */
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .background-content-image {
            position: absolute;
            /* 重点，不能让背景大过于展示的图片 */
            z-index: -1;
            width: 260px;
            height: 100%;
            filter: blur(8px);
            background-image: url(https://gw.alipayobjects.com/zos/antfincdn/LlvErxo8H9/photo-1503185912284-5271ff81b9a8.webp);
            background-size: 100%;
            background-position: center;
            background-repeat: no-repeat;
        }

        img {
            max-height: 100%;
        }
    </style>

</head>
<body>
<div class="background">
    <div class="background-content">
        <div class="background-content-image"></div>
        <img
                src="https://gw.alipayobjects.com/zos/antfincdn/LlvErxo8H9/photo-1503185912284-5271ff81b9a8.webp"
                alt="测试图片"
        />
    </div>
</div>
</body>
</html>
